﻿using Microsoft.Xna.Framework;

namespace Tribaan
{
    internal static class GameExtensions
    {
        public static T AddService<T>(this GameServiceContainer @this, T serviceProvider)
        {
            @this.AddService(typeof(T), serviceProvider);
            return serviceProvider;
        }

        public static void RemoveService<T>(this GameServiceContainer @this)
        {
            @this.RemoveService(typeof(T));
        }

        public static T GetService<T>(this GameServiceContainer @this)
        {
            return (T)@this.GetService(typeof(T));
        }
    }
}